package com.example.utils;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class Results implements Serializable {
    private Integer code;
    private String message;

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Map<String, Object> getData() {
        return data;
    }

    public void setData(Map<String, Object> data) {
        this.data = data;
    }

    private Map<String, Object> data = new HashMap<>();

    public Results  code(Integer code){
        this.code=code;
        return this;
    }

    public Results message(String message){
        this.message=message;
        return this;
    }
    public Results setCode(Integer code){
        this.code=code;
        return this;
    }

    public Results data(String key, Object value){
        this.data.put(key,value);
        return this;
    }
    public Results data(Map map){
        this.data = map;
        return this;
    }
}
